﻿Public Class formvncview

    Private Sub formvncview_Load(sender As Object, e As EventArgs) Handles MyBase.Load

    End Sub

    Private Sub btnvncfull_Click(sender As Object, e As EventArgs) Handles btnvncview.Click
        Dim parametros2 As String


        ' parametros = "/user %username% /password" + passdomain
        parametros2 = textipvncview.Text
        lbnerrorview.Text = ""
        If textipvncview.Text = "" Then
            MsgBox("Please Insert IP Address", MsgBoxStyle.Exclamation)
            Return
        End If

        If My.Computer.Network.Ping(parametros2) = True Then
            Dim oProcess As New Process()
            Dim oStartInfo As New ProcessStartInfo("c:\Program Files\TechTools\vncviewer.exe", parametros2 & " " & "/viewonly" & " " & "/user" & " " & globalvar.userdomain & " " & "/password" & " " & globalvar.passdomain)
            oStartInfo.UseShellExecute = False
            oStartInfo.RedirectStandardOutput = True
            oProcess.StartInfo = oStartInfo
            oProcess.Start()
            textipvncview.Clear()
        Else
            lbnerrorview.Text = "IP Adress is shutdown or incorrect"
            Return
            textipvncview.Clear()
        End If




        Me.Close()


    End Sub

    Private Sub lbnipvncview_Click(sender As Object, e As EventArgs) Handles lbnipvncview.Click

    End Sub

    Private Sub textipvncview_TextChanged(sender As Object, e As EventArgs) Handles textipvncview.TextChanged

    End Sub

    Private Sub Button1_Click(sender As Object, e As EventArgs)
        Me.Close()

    End Sub
End Class